<?php
$html = null;
if(have_posts())
{
	//$image_rs = new SimpleImage();
	while (have_posts())
	{
		the_post();
		$postID = get_the_ID();
		$title = get_the_title($postID);
		$perlink = get_permalink($postID);
		$alt = db_vietnamese_slug($title);
		$thumbnail = db_get_post_meta($postID, $wpdb->prefix.'thumbnail');
		//if($thumbnail)
			//$thumbnail = db_resizeImage($image_rs, $thumbnail, 149, 79);
		$price = get_post_meta($postID,$wpdb->prefix.'price',true);
		$location = get_post_meta($postID, $wpdb->prefix.'address',true);
		$lenght_of_stay = get_post_meta($postID, $wpdb->prefix.'lenght_of_stay',true);
		$html.='		
		<li>
                        	<a href="'.$perlink.'" title="'.$title.'"><img src="'.$thumbnail.'" alt="'.$alt.'" /></a>
                            <p class="tendanhsachtour"><a href="'.$perlink.'" title="'.$title.'">'.db_shortDesc($title, 30).'</a></p>
                            <p class="giatour">Price: '.$price.' USD</p>
                            <p>'.$lenght_of_stay.'</p>
                        </li>';		
	}	
	//unset($image_rs);
}
else 
{
	$html.='<li>No tour!.</li>';
}
echo $html;
